package net.oschina.app.previousTest;

import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import android.widget.EditText;

import com.robotium.solo.Solo;

import net.oschina.app.AppStart;

/**
 * Created by Administrator on 2017/6/30.
 */

public class IndexTest extends ActivityInstrumentationTestCase2 {

    private Solo solo;

    public IndexTest() {
        super(AppStart.class);
    }

    @Override
    public void setUp() throws Exception {
        super.setUp();
        solo = new Solo(getInstrumentation(), getActivity());
    }

    public void testName() throws Exception {
        //按 文本定位  我的
        solo.clickOnText("我的");
        solo.clickOnText("点击头像登录");
        //通过index取 文本框 的方法
        //index 从0开始   0是 第一个
        EditText pwdET = solo.getEditText(1);
        //获取 文本框 默认显示文本的方法，这个方法是android SDK提供的
        String hintPWD = pwdET.getHint().toString();
        Log.i("AUTO",hintPWD);
//        Log.i("AUTO","==================="+hintPWD);

    }

    @Override
    public void tearDown() throws Exception {
        solo.finishOpenedActivities();
        super.tearDown();
    }
}
